home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / bash-1.12 / dist / support / cppmagic < prev    next >
Encoding:
Text File  |  1991-11-22  |  450 b   |  29 lines

  1. #!/bin/sh
  2. # Make a list of flags to pass to /lib/cpp.
  3. #
  4.  
  5. if [ "$2" ]; then
  6.   Cpp=$2
  7. else
  8.   if [ -f /lib/cpp ]; then
  9.     Cpp=/lib/cpp
  10.   else
  11.     Cpp=cpp
  12.   fi
  13. fi
  14.  
  15. TRADITIONAL=
  16. FLAGS=
  17.  
  18. # First flag might be `-traditional' if this is Gnu Cpp.
  19. unknown_flag=`$Cpp -traditional /dev/null 2>&1 |
  20.           egrep 'known|recognized|valid|bad'`
  21. if [ ! "$unknown_flag" ]; then
  22.   TRADITIONAL=-traditional
  23. fi
  24.  
  25. if [ "$1" ]; then
  26.    FLAGS=`$1`
  27. fi
  28. echo $TRADITIONAL $FLAGS
  29.